// 菜单项
const componentBehaviors = require('../../../behaviors/component');
import { COMPONENT_OPTIONS } from '../../../constants/common';
import { navTo } from '../../../common/env';
Component({
    behaviors: [componentBehaviors],
    options: {
        ...COMPONENT_OPTIONS,
    },
    properties: {
        icon: String,
        name: String,
        link: String,
        openType: {
            type: String,
            value: '',
        },
    },
    data: {},
    methods: {
        // 点击事件
        clickAction: function () {
            if (this.data.link) {
                navTo(this.data.link);
            } else {
                this.triggerEvent('click');
            }
        },
    }
})
